<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">

    <title>代理人 </title>

    <meta name="keywords" content="">
    <meta name="description" content="">

    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->

    <link rel="shortcut icon" href="{$Think.const.RESOURCE}img/favicon.ico">
    <link href="{$Think.const.RESOURCE}css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="{$Think.const.RESOURCE}css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="{$Think.const.RESOURCE}css/animate.css" rel="stylesheet">
    <link href="{$Think.const.RESOURCE}css/style.css?v=4.1.0" rel="stylesheet">
    <link href="{$Think.const.RESOURCE}css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <style>
        :-moz-placeholder { /* Mozilla Firefox 4 to 18 */
            color: #b6b6b6; opacity:1;
        }

        ::-moz-placeholder { /* Mozilla Firefox 19+ */
            color: #b6b6b6;opacity:1;
        }

        input:-ms-input-placeholder{
            color: #b6b6b6;opacity:1;
        }

        input::-webkit-input-placeholder{
            color: #b6b6b6;opacity:1;
        }
    </style>
</head>

<body class="fixed-sidebar full-height-layout gray-bg">
<div class="row" style="height:260px;">
    <div class="col-md-4 text-right" style="background-color: #f4dfa9;margin-right: 10px;">
        <!--<button type="button" class="btn btn-warning"  data-toggle="modal" data-target="#myModalAdd">生成金币</button>-->
        <h2 class="text-center">用户金额信息</h2>
        
            <div class="col-md-8">
                <div class=" form-group ">
                    <div class=" input-group ">
                         <span class="input-group-addon ">用户名称*</span>
                        <input    class="form-control required" value="{$result[0]['nickname']}" disabled>
                        <span class="input-group-addon ">用户金额*</span>
                        <input   type="number" class="form-control required" value="{$result[0]['Score']}" disabled>
                         <span class="input-group-addon ">银行金额 *</span>
                        <input   type="number" id="bankgolds" class="form-control required" value="{$result[0]['bankgold']}" disabled>
                        <input   type="hidden" class="form-control required" id="accountid" value="{$result[0]['AccountID']}">

                    </div>
                   
                    <div class=" input-group ">
                        <span class="input-group-addon ">扣除金额*(扣除的是银行金额)</span>
                        <input name="gold" type="number" id="kcjb" class="form-control required" min="0" placeholder="请填写金额">
                    </div>
                </div>
            </div>
            <div class="col-md-2 text-center">
                <button type="button"  id="sends"  class="btn btn-danger btn_sub">扣除金币</button>
            </div>
        
    </div>
   
</div>
<!-- 全局js -->
<script src="{$Think.const.RESOURCE}js/jquery.min.js?v=2.1.4"></script>
<script src="{$Think.const.RESOURCE}js/bootstrap.min.js?v=3.3.6"></script>
<script src="{$Think.const.RESOURCE}js/plugins/sweetalert/sweetalert.min.js"></script>
<script type="text/javascript" src="{$Think.const.RESOURCE}js/content.js"></script>
<script>
    $(function(){
            $('#sends').click(function(){
                var r=confirm("您确定要扣除么");
                if (r==true){
                    var bankgold=$("#bankgolds").val();  //本金
                    var kcjb=$("#kcjb").val();    //扣除金额
                    var czgold=bankgold-kcjb;
                    if(czgold>=0 && kcjb>0){
                            $.ajax({
                                 type: "GET",
                                  url:"/member/kcmoneys",
                                 data: {accountid:$("#accountid").val(),kcjb:czgold,kcjbs:kcjb},
                                 dataType: "json",
                                 success: function(data){
                                     alert(data);  
                                     window.location.reload();       
                                 }
                            });  
                    }else{
                        alert("扣除金额不能大于银行金额");
                    }
                }
                   
            });
    });
</script>

</body>

</html>